<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="./vue.js">
			
		</script>
	</head>
	<body>
		<div id="app">
			<button type="button" @click="say">let's say {{msg}}</button><br>
			<button type="button"@click="warn('yuan',$event)">warn</button><br>
			<div @click="todo">
				<button @click="dothis">dothis1</button>
			</div>
			<div @click="todo">
				<button @click.stop="dothis">dothis2</button>
				
			</div>
			<a href="http://www.runoob.com"  @click.prevent="dostop">dostop</a>
			 <button @click.once="doOnly">点击事件只会触发一次：{{num}}</button>
			 <input type="text" @keyup.a="submit"/>
		</div>
		<script type="text/javascript">
			var vm = new Vue({
				el:"#app",
				data:{
					msg:"hello world",
					num:0
				},
				methods:{
					say(event){
						alert(this.msg)
						alert(event.target.innerHTML)
					},
					warn(name,$event){
						alert(name+','+event.target.tagName)
					},
					todo(){
						alert('todo')
						
					},
					dothis(){
						alert("dothis")
						
					},
					dostop(){
						alert("dostop")
					},
					doOnly(){
						this.num++;
					},
					submit(){
						alert("确定提交？")
					}
					
					
				}
			})
		</script>
	</body>
</html>
